<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EvilBlog Setup</title>
</head>
<body>
<?php
$sqlfile = 'setup.sql';
if(!is_readable($sqlfile)) {
	exit('数据库文件不存在或者读取失败');
}
$fp = fopen($sqlfile, 'rb');
$sql = fread($fp, 2048000);
fclose($fp);

mysql_connect("localhost","test","test") or die("Cannot connect to the host.");
mysql_select_db("test") or die("Select database error.");

$queries = explode(";",$sql);
for($num=0;$num<sizeof($queries);$num++)
{
    $queries[$num] = str_replace('\r','\n',$queries[$num]);
    echo $queries[$num]."<br>";
}

?>
</body>
</html>